# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# This file is based on the AUR package by amadejpapez <amadej.papez@gmail.com>

pkgname=python-name-that-hash
_pkgname=name_that_hash
pkgver=1.11.0
pkgrel=5
pkgdesc='The Modern Hash Identification System.'
arch=('any')
url='https://github.com/HashPals/Name-That-Hash'
license=('GPL3')
depends=('python' 'python-click' 'python-rich')
makedepends=('python-build' 'python-installer' 'python-pip' 'python-poetry-core'
             'python-wheel')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f5fed6fa86985d69bc099eb12227a01ef83337524d06a5f0bcfb4b1c1f362e1d207deece7577b954d4a4949c949f10cef9c6823f784b02d90a17dcc76d6be342')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    "$_pkgname"
}

